function hishow(id) {
    var divname="hsdiv"+id;
    if(document.getElementById(divname).style.display=="") {
        document.getElementById(divname).style.display="none";
        document.getElementById("arrow"+id).src="/assets/backend/onlineCustomerServiceTheme/default/arrow_down.gif";
    } else {
        document.getElementById(divname).style.display="";
        document.getElementById("arrow"+id).src="/assets/backend/onlineCustomerServiceTheme/default/arrow_right.gif";
    }
}
//createIconDivMain
function _createIconDivMain() {
    if (document.getElementById(this.config["iconDiv"])==null) {
        var id=this.config["id"];
        setTimeout('kf_icons['+id+'].createIconDivMain()',500);
        return ;
    }
    if (document.getElementById(this.config["iconDiv"]).innerHTML.indexOf('.gif')!=-1
        || document.getElementById(this.config["iconDiv"]).innerHTML.indexOf('.jpg')!=-1
        || document.getElementById(this.config["iconDiv"]).innerHTML.indexOf('.swf')!=-1) {
        return ;
    }

    var html="";
    if (this.config["iframe_flag"]==1) {
        //html += "<iframe  style='position:absolute;z-index:7998;width:expression(this.nextSibling.offsetWidth);height:expression(this.nextSibling.offsetHeight);top:expression(this.nextSibling.offsetTop);left:expression(this.nextSibling.offsetLeft);' frameborder='0' ></iframe>";
    }

    var kf="";
    kf += "<div style=\"width:120px;text-align:left;background:url(/assets/backend/onlineCustomerServiceTheme/default/topbg.gif) left top no-repeat;;text-align:center;font-family:Arial;font-size:12px;\" id=\"kfclient\"><div style=\"height:27px;\"></div><div style=\"width:120px;background:url(/assets/backend/onlineCustomerServiceTheme/default/mainbg.gif); overflow:hidden; \">";
    kf += "<div style=\"width:110px;height:21px;* height:19px !important;* height:19px;padding:2px 0 0 6px; overflow:hidden;margin:0 4px; background:url(/assets/backend/onlineCustomerServiceTheme/default/listbg.gif) no-repeat;font-size:12px;color:#313031;font-weight:bold;cursor:pointer;text-align:left;\"onclick=\"hishow(1266852484)\"><img src=\"/assets/backend/onlineCustomerServiceTheme/default/arrow_right.gif\" border=\"0\" width=\"13\" height=\"13\" style=\"vertical-align:middle; margin-bottom: 3px;\" id=\"arrow1266852484\" /> 技术部</div><div id=\"hsdiv1266852484\"><table border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:112px;background:none;font-size:12px;\"><tr><td style=\"width:110px;height:22px;\" align=\"center\"><div style=\"width:100px;white-space:nowrap; overflow:hidden; text-align: center;\"><a target=\"blank\" href=\"http://wpa.qq.com/msgrd?V=1&Uin=958540085&Site=DoIt 建站系统演示站点&Menu=yes\"><img border=\"0\" src=http://wpa.qq.com/pa?p=1:958540085:6 alt=\"点击这里给我发消息\" align=\"absmiddle\"></a></div></td></tr></table></div><div style=\"width:110px;height:21px;* height:19px !important;* height:19px;padding:2px 0 0 6px; overflow:hidden;margin:0 4px; background:url(/assets/backend/onlineCustomerServiceTheme/default/listbg.gif) no-repeat;font-size:12px;color:#313031;font-weight:bold;cursor:pointer;text-align:left;\"onclick=\"hishow(1266843585)\"><img src=\"/assets/backend/onlineCustomerServiceTheme/default/arrow_right.gif\" border=\"0\" width=\"13\" height=\"13\" style=\"vertical-align:middle; margin-bottom: 3px;\" id=\"arrow1266843585\" /> 客服</div><div id=\"hsdiv1266843585\"><table border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:112px;background:none;font-size:12px;\"><tr><td style=\"width:110px;height:22px;\" align=\"center\"><div style=\"width:100px;white-space:nowrap; overflow:hidden; text-align: center;\"><a target=\"blank\" href=\"http://wpa.qq.com/msgrd?V=1&Uin=958540085&Site=DoIt 建站系统演示站点&Menu=yes\"><img border=\"0\" src=http://wpa.qq.com/pa?p=1:958540085:6 alt=\"点击这里给我发消息\" align=\"absmiddle\"></a></div></td></tr><tr><td style=\"width:110px;height:22px;\" align=\"center\"><div style=\"width:100px;white-space:nowrap; overflow:hidden; text-align: center;\"><a target=\"blank\" href=\"http://wpa.qq.com/msgrd?V=1&Uin=978595165&Site=DoIt 建站系统演示站点&Menu=yes\"><img border=\"0\" src=http://wpa.qq.com/pa?p=1:978595165:6 alt=\"点击这里给我发消息\" align=\"absmiddle\"></a></div></td></tr></table></div>";
    kf += "</div></div><div style=\"width:120px;height:12px;* height:12px !important;* height:12px; background:url(/assets/backend/onlineCustomerServiceTheme/default/btbg.gif) no-repeat;\"></div>";
    html += "<DIV id='"+this.config["iconDivMain"]+"' style='z-index:7999;display:"+this.display+";left: "+this.left+"px; top: "+this.top+"px;width:"+this.config["width"]+"px;height:auto; overflow:hidden;POSITION: absolute;'>"+this.closeIcon()+kf+"</div>";

    document.getElementById(this.config["iconDiv"]).innerHTML=html;
    this.iconDivMain=document.getElementById(this.config["iconDivMain"]);
}

//to avoid the no

if (typeof(kf_icons)=="undefined") {
    var kf_icons=new Array();

    function kfIcon() {
        this.config=new Array();
        this.left=-200;//图标需要到达的 left
        this.top=0;
        this.width=0;//图标宽度
        this.height=0;//图标宽度
        this.offsetLeft=0;//距离左侧宽度，包括滚动过的距离
        this.scrolledX=0;//图标水平滚动条滚动过的距离
        this.scrolledY=0;
        this.issmooth=false;//是否平滑移动
        this.loopmillisecond=40;//图标循环定位的毫秒，数值越大越慢，对CPU影响越小
        this.Xstep=4;//水平步进基数,数字越大越平滑，也越慢
        this.Ystep=4;
        this.pageW=0;//页面总宽度
        this.pageH=0;
        this.display="";//是否显示图标,值 "none"|""
        this.iscloseIcon=1; //是否显示关闭按钮
        this.iconDiv=null;
        this.iconDivMain=null;
        this.autoScrollTimer=null;

        this.init=_init;
        this.autoScroll=scroll;
        this.createIconDivMain=_createIconDivMain;//
        this.setParameter=_setParameter;//在 createIconDivMain 中调用
        this.closeIcon=_closeIcon; //同上
        this.hidden=_hidden; //同上
    };

    //has defined
    function hasdoctype() {
        var ret=false;
        try {
            if(document.compatMode=="BackCompat")
                ret=false;
            else if (document.compatMode=="CSS1Compat")
                ret=true;
            else
                ret=true;
        } catch(e) {
            ret=false
        }
        return ret;
    }

    // ie8 =  IE8_Partner_Build [2008-12-11]
    function detectBrowser() {
        var ret="ie6"; // default
        var user_agent = navigator.userAgent;
        if(user_agent.indexOf("compatible")>-1) {
            if(user_agent.indexOf("MSIE 6.0") > -1)
                ret="ie6"
            else if(user_agent.indexOf("MSIE 7.0") > -1)
                ret="ie7";
            else if(user_agent.indexOf("MSIE 8.0") > -1)
                ret="ie8";
        } else if(user_agent.indexOf("Gecko") > -1)
            ret="firefox";

        return ret;
    }
    var hasdoctype=hasdoctype();
    var browser=detectBrowser();
    function scroll() {
        try {
            this.offsetLeft=this.iconDivMain.offsetLeft;
            this.width=parseInt(this.iconDivMain.style.width.replace("px",""));
            this.height=parseInt(this.iconDivMain.style.width.replace("px",""));
        } catch(e) {
            this.iconDivMain=document.getElementById(this.config["iconDivMain"]);
            return ;
        }

        this.scrollbarW=20;// scrollbar width in ie6,ie7,ie8 = 20px
        this.scrolledY = document.body.scrollTop;
        this.scrolledX = document.body.scrollLeft;
        if(this.scrolledY==0)
            this.scrolledY = document.documentElement.scrollTop;
        if(this.scrolledX==0)
            this.scrolledX = document.documentElement.scrollLeft;

        if(browser=="ie6") {
            this.pageH = document.documentElement.offsetHeight;
            this.pageW = document.documentElement.offsetWidth;
        } else if(browser=="ie7") {
            this.pageH = document.documentElement.offsetHeight;
            if(hasdoctype)
                this.pageW = document.documentElement.offsetWidth+21;
            else
                this.pageW = document.documentElement.offsetWidth;
        } else if(browser=="ie8") {
            this.pageH = document.documentElement.offsetHeight;
            this.pageW = document.documentElement.offsetWidth;
        } else if(browser=="firefox") {
            this.pageH = window.innerHeight;
            // 21=17+4
            // 17 for document.documentElement.clientWidth in firefox 3
            // 4 for document.documentElement.scrollLeft in firefox 3 differently from ie6,ie7
            //
            this.pageW = document.documentElement.clientWidth+21;
        } else {
            this.pageH = document.documentElement.offsetHeight;
            this.pageW = document.documentElement.offsetWidth;
        }

        if(this.top!=(this.scrolledY+this.config["offsetH"])) {
            this.top=this.scrolledY+this.config["offsetH"];
        }

        if(this.config["showmodel"]==1) {
            if(this.left!=(this.scrolledX+this.pageW)) {
                var iconDivWidth=this.scrolledX+this.config["offsetW"]-this.offsetLeft;
                iconDivWidth=(iconDivWidth>0?1:-1)*Math.ceil(Math.abs(iconDivWidth));
                this.left=this.offsetLeft+iconDivWidth;
            }
        } else {
            if(this.left!=(this.scrolledX+this.pageW-this.width-this.config["offsetW"]-this.scrollbarW))
            {
                var iconDivWidth=this.scrolledX+this.pageW-this.width-this.config["offsetW"]-this.scrollbarW-this.offsetLeft;
                iconDivWidth=(iconDivWidth>0?1:-1)*Math.ceil(Math.abs(iconDivWidth));
                this.left=this.offsetLeft+iconDivWidth;
            }
        }
        //set kf_icon postiotn
        //超出窗口边界，直接移动到窗口边界再平滑移动
        var left=parseInt(this.iconDivMain.style.left.replace("px",""));
        var top=parseInt(this.iconDivMain.style.top.replace("px",""));
        //var shallMove=false;
        if(this.issmooth==true) {
            if(left!=this.left) {
                if(left<(this.scrolledX-this.width))
                    left=this.scrolledX-this.width;
                if(left>this.scrolledX+this.pageW)
                    left=this.scrolledX+this.pageW;
                left=smoothMove(left,this.left);
            //shallMove=true;
            }
            if(top!=this.top) {
                if(top<(this.scrolledY-this.height))
                    top=this.scrolledY-this.height;
                if(top>this.scrolledY+this.pageH)
                    top=this.scrolledY+this.pageH;
                top=smoothMove(top,this.top);
            //shallMove=true;
            }
        } else if(this.issmooth==false) {
            left=this.left;
            top=this.top;
            this.issmooth=true;
        }
        this.iconDivMain.style.left=left+"px";
        this.iconDivMain.style.top=top+"px";
    }

    //间距小于步进，则移动间距的距离
    function smoothMove(start,end) {
        var step=(end-start)*0.2;
        posi=start+step;
        if(step>0) {
            if(posi>end)
                posi=end;
        } else {
            if(posi<end)
                posi=end;
        }
        return posi;
    }
    function _setParameter() {}
    function _closeIcon() {
        if (this.iscloseIcon) return"<img onclick='kf_icons["+this.config["id"]+"].hidden()' style='position:absolute; right:7px;top:4px; cursor:hand;' src='/assets/backend/onlineCustomerServiceTheme/default/close.gif'/>";
          return "";
    }
    function _hidden() {
        this.display = 'none';
        document.getElementById(this.config["iconDivMain"]).style.display = 'none';
        try {
            clearInterval(kf_icons[this.config["kf_icon_id"]].autoScrollTimer);
        } catch(e){}
    }
    function _init() {
        document.write('<div id="'+this.config["iconDiv"]+'" ></div>');
        this.iconDiv=document.getElementById(this.config["iconDiv"]);
        this.createIconDivMain();
    };
}

if(typeof(kf_icon_id)=="undefined")
    kf_icon_id=1;
else
    kf_icon_id++;
    kf_icons[kf_icon_id]=new kfIcon();
    kf_icons[kf_icon_id].config["id"]=kf_icon_id;
    kf_icons[kf_icon_id].config["arg"]="1000029";
    kf_icons[kf_icon_id].config["iframe_flag"]="1";
    kf_icons[kf_icon_id].config["IsState"]="&IsState=0";
    kf_icons[kf_icon_id].config["isonline"]="0";
    kf_icons[kf_icon_id].config["img_on"]="/assets/backend/onlineCustomerServiceTheme/default/on.gif";
    kf_icons[kf_icon_id].config["img_off"]="/assets/backend/onlineCustomerServiceTheme/default/off.gif";
    kf_icons[kf_icon_id].config["height"]="168";
    kf_icons[kf_icon_id].config["width"]="120";
    kf_icons[kf_icon_id].config["showmodel"]=parseInt("2");  //1为左，2为右
    kf_icons[kf_icon_id].config["offsetW"]=parseInt("2");   //距离左侧或者右侧
    kf_icons[kf_icon_id].config["offsetH"]=parseInt("215");  //距离顶部
    kf_icons[kf_icon_id].config["iconDivMain"]="iconDivMain"+kf_icon_id;
    kf_icons[kf_icon_id].config["iconDiv"]="iconDiv"+kf_icon_id;

    kf_icons[kf_icon_id].init();
    eval('kf_icons['+kf_icon_id+'].autoScrollTimer=window.setInterval("kf_icons['+kf_icon_id+'].autoScroll()", '+kf_icons[kf_icon_id].loopmillisecond+');');